package com.chenfan.mcn.controller;

import com.chenfan.mcn.extension.Res;
import com.chenfan.mcn.model.Quarter;
import com.chenfan.mcn.model.vo.QuarterVO;
import com.chenfan.mcn.service.QuarterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 季度信息
 * @author:   tangwei
 * Date:     2021/4/16 18:24
 * Description: 季度
 */
@RestController
@RequestMapping("/quarter")
public class QuarterController {

    @Autowired
    private QuarterService quarterService;

    /**
     * 季度下拉-当前+往后推4个季度
     * @return
     */
    @GetMapping("/getList")
    public Res<List<Quarter>> getQuarter() {
        return Res.ok(quarterService.getQuarter());
    }

    /**
     * 季度下拉-当前+往前推4个季度
     * @return
     */
    @GetMapping("/getBeforeList")
    public Res<List<Quarter>> getBeforeList() {
        return Res.ok(quarterService.getBeforeList());
    }


    /**
     * 季度下拉-过去所有+当前往后推4个季度
     * @return
     */
    @GetMapping("/getAll")
    public Res<List<QuarterVO>> getAll() {
        return Res.ok(quarterService.getAll());
    }
}